<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="https://cdn.bootcdn.net/ajax/libs/vue/2.6.12/vue.min.js"></script>
    <title>Document</title>
</head>
<style>
    .info {
        margin: 16px 20px;
        font-size: 16px;
        color: azure;
        background-color: burlywood;
    }

    .info.warning {
        background-color: coral;
    }

    .info.danger {
        background-color: crimson;
    }
    li{
        margin-top: 7px;
    }
</style>

<body>
    <div id="root">
        <p>
            <input type="text" v-model="temp">
        </p>
        <p>
            <span class="info" v-show="temp<40">正常温度：{{temp}}℃</span>

            <span class="info warning" v-show="temp>=40 && temp<70">警告温度：{{temp}}℃</span>

            <span class="info danger" v-show="temp>=70">危险温度：{{temp}}℃</span>
        </p>
        <p>
            <span class="info" v-if="temp<40">正常温度：{{temp}}℃</span>

            <span class="info warning" v-else-if="temp<70">警告温度：{{temp}}℃</span>

            <span class="info danger" v-else="">危险温度：{{temp}}℃</span>
        </p>
        <ul>
            <li v-for="(itme,index) in list">
                <span>{{index}}</span>

                <span>时间：{{itme.time}}</span>

                <span class="info" v-if="itme.temp<40">正常温度：{{itme.temp}}℃</span>

                <span class="info warning" v-else-if="itme.temp<70">警告温度：{{itme.temp}}℃</span>

                <span class="info danger" v-else>危险温度：{{itme.temp}}℃</span>
            </li>
        </ul>
    </div>
    <script>
        new Vue({
            el: '#root',
            data() {
                return {
                    temp: 26,
                    list:[
                        {time:"11:10",temp:30},
                        {time:"11:20",temp:50},
                        {time:"11:30",temp:77},
                        {time:"11:40",temp:21},
                        {time:"11:50",temp:58},
                        {time:"12:00",temp:41}
                    ]
                }
            }
        })
    </script>
</body>

</html>